<!-- 三栏布局，两边固定宽度，中间自适应 -->
<!-- 第一种利用flex布局 -->
<!-- 第二种利用calc计算出中间的大小值 width: calc(100% - 400px); 使用calc方法时，如果div标签换行了，这个换行也是会在页面保留相应的位置-->
<!-- 第三种BFC块级格式化上下文Block Formatting Context -->
<!-- float与负margin的搭配使用 -->
<!-- grid二维实现三栏布局 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三栏布局</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        /* .container{
            height: 400px;
            display: flex;
        }
        .left{
            width: 200px;
            background-color:  goldenrod;
        }
        .center{
            flex:1;
            background-color:  rgb(41, 201, 36);
        }
        .right{
            width: 200px;
            background-color:  rgb(36, 195, 201);
        } */



        /* .container{
            height: 400px;
            background-color: hotpink;
        }
        .container > div{
            display: inline-block;
            height: 100%;
            color: indigo;
        }
        .container > .left{
            width: 200px;
            background-color: rgb(231, 170, 170);
        }
        .container > .center{
            width: calc(100% - 400px);
            background-color: lightsalmon;
        }
        .container > .right{
            width: 200px;
            background-color: rgb(235, 26, 26);
        } */


        /* .container{
            height: 400px;
            border: 1px solid blue;
        }
        .container div{
            height: 100%;
        }
        .container .left{
            width: 200px;
            float: left;
            background-color: rgb(199, 220, 233);
        }
        .container .right{
            width: 200px;
            float: right;
            background-color: rgb(61, 167, 233);
        }
        .container .center{
            display: flex;
            background-color: rgb(76, 128, 161);
        } */
        
        /* .container{
            height: 400px;
            border: 1px solid hotpink;
        }
        .container div{
            color: #fff;
            height: 100%;
        }
        .container > .left{
            float: left;
            width: 200px;
            margin-left: -100%;
            background-color: lawngreen;
        }
        .container > .main-container{
            float: left;
            width: 100%;
        }
        .container > .main-container > .main{
            margin-left: 200px;
            margin-right: 200px;
            background-color: lightgreen;
        }
        .container > .right{
            float: right;
            width: 200px;
            margin-left: -100%;
            background-color: lawngreen;
        } */
        .container{
            height: 400px;
            display: grid;
            grid-template-columns: 200px auto 200px ;
            border: 1px solid orange;
        }
        .container .left{
            background-color: orangered;
        }
        .container .main{
            background-color: rgb(170, 53, 11);
        }
        .container .right{
            background-color: rgb(247, 199, 181);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="left">left</div>
        <div class="main">main</div>
        <div class="right">right</div>
    </div>
</body>
</html>